home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / printf.pas < prev    next >
Pascal/Delphi Source File  |  1995-04-22  |  1KB  |  59 lines

  1. PROGRAM PRINTFILE(INPUT,OUTPUT); 
  2.  
  3. LABEL 1; 
  4.  
  5. var 
  6.  f :text; 
  7.  s :array[0..80] of char; 
  8.  PRINTER :INTEGER; 
  9.  ANS :INTEGER; 
  10.  
  11. procedure TOSCREEN; 
  12.  
  13. BEGIN 
  14.   Reset(f,s); 
  15.   while not eof(f) do begin 
  16.     if eoln(f) then writeln 
  17.     else write(f^); 
  18.     get(f); 
  19.   end; 
  20. END; 
  21.  
  22. procedure toprinter; 
  23.  
  24. BEGIN   
  25.    reset(f,s); 
  26. #i D:PR.ON 
  27.    while not eof(f) do begin 
  28.      if eoln(f) then writeln 
  29.      else write(f^); 
  30.      get(f); 
  31.    end; 
  32. #i D:PR.OFF 
  33. END; 
  34.  
  35.  
  36.   begin 
  37.  
  38. 1: Printer := 0; 
  39.   write(CHR(125)); 
  40.   writeln('This program will allow you to look'); 
  41.   Writeln('at any disk file. It is designed'); 
  42.   Writeln('as a demo for KYAN pascal'); 
  43.   Writeln; 
  44.   Writeln('press <RETURN> to continue'); 
  45.   readln(s); 
  46.   WRITELN('1) PRINTER'); 
  47.   WRITELN('2) SCREEN '); 
  48.   Readln(ANS); 
  49.   printer := ans; 
  50.   if printer = 0 Then goto 1; 
  51.   write('FILENAME? ');readln(s); 
  52.   if printer = 1 Then toprinter; 
  53.   if printer = 2 then toscreen; 
  54.   Writeln; 
  55.   Writeln('press <RETURN> to continue'); 
  56.   readln(s); 
  57.   GOTO 1; 
  58. end. 
  59. ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓